home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / pwd-1_0.lha / pwd-1.0 / src / pwd.mod next >
Text File  |  1995-12-23  |  1KB  |  62 lines

  1. (***************************************************************************
  2.  
  3.     MODUL
  4.       pwd.mod
  5.  
  6.     DESCRIPTION
  7.       Pwd prints out the current working directory. No more, no less. ;-)
  8.  
  9.     NOTE
  10.       compiled with Oberon-A, OC version 5.37
  11.       ( A lot of thanks to Frank for his great compiler ! )
  12.  
  13.     BUGS
  14.       What ? Hhhm if there is at least one, report it to:
  15.          roland.jesse@student.uni-magdeburg.de
  16.  
  17.     HISTORY
  18.       23-12-95 Roland (rj,-) Jesse  created
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *>             (* necessary for assignable cleanup procedure *)
  23.  
  24. MODULE pwd;
  25.  
  26. IMPORT
  27.    pwdRev,
  28.    Errors, Kernel,
  29.    Dos,
  30.    S := SYSTEM,
  31.    Strings;
  32.  
  33.  
  34. VAR
  35.    success : BOOLEAN;
  36.    len, i : INTEGER;
  37.    buf : ARRAY 256 OF CHAR;
  38.  
  39.  
  40. (* Remove all the allocated stuff *)
  41. PROCEDURE* Cleanup (VAR rc : LONGINT);
  42. BEGIN
  43.  
  44. END Cleanup;
  45.  
  46.  
  47. BEGIN (* pwd *)
  48.    Errors.Init;
  49.    Kernel.SetCleanup (Cleanup);
  50.  
  51.    (* Sorry, but OS2+ is needed. *)
  52.    ASSERT (Dos.base.lib.version >= 36, Dos.fail);
  53.  
  54.    buf[0] := 0AX;
  55.    len := 256; (* number of bytes for the buffer *)
  56.    success := Dos.GetCurrentDirName (buf, len);
  57.    Strings.Append ("\n", buf);
  58.    success := Dos.FPuts (Dos.Output (), buf);
  59.  
  60. END pwd.
  61.  
  62.